package cn.maxhou.sz1.entity;

import cn.maxhou.sz1.entity.Paper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

@Component("printer")
public class Printer {
    @Autowired
    @Qualifier("Color")
    private Cartridges cartridges;

    @Autowired
    @Qualifier("A4")
    private Paper paper;

    public Cartridges getCartridges() {
        return cartridges;
    }

    public void setCartridges(Cartridges cartridges) {
        this.cartridges = cartridges;
    }

    public Paper getPaper() {
        return paper;
    }

    public void setPaper(Paper paper) {
        this.paper = paper;
    }

    public void print(){
        System.out.println("我正在用"+cartridges.getType()+"在"+paper.getType()+"上打印文字");
    }
}
